/*
    window.addEvent('domready', function() {
        $("jc_home").addClass("on");
    });
*/

var menubox = $("menu_box"),menu = $("menu"),menuItems = $ES('li', 'menu');
menubox.setStyle("opacity", 0);
menu.setStyle("opacity", 0);

new Asset.images(['images/jcmenu/menu_bg.png','images/jcmenu/menu_l.png','images/jcmenu/menu_r.png','images/jcmenu/menu_item.gif'], {
    onComplete:function() {
        menubox.setStyle("visibility", "visible")
        new Fx.Styles(menubox, {duration:2000,transition: Fx.Transitions.Bounce.easeOut}).start({
            'width':[90,515],
            'opacity':[0,1]
        }).chain(function() {
            new Fx.Style(menu, 'opacity', {duration:300}).start(1);
            menuItems.each(function(item, index) {
                if (item.className != 'on') {
                    item.addEvent('mouseenter', function() {
                        this.setStyles({'background-position':'center 0px'});
                        $ES('a', this)[0].setStyle('color', '#999999');
                    });
                    item.addEvent('mouseleave', function() {
                        this.setStyles({'background-position':'center -50px'});
                        $ES('a', this)[0].setStyle('color', '#ffffff');
                    });
                }
            });

        });
    }
});